package cn.zyq.ykb.controller.h5.user;

import cn.zyq.ykb.beans.user.User;
import cn.zyq.ykb.beans.user.UserBalance;
import cn.zyq.ykb.service.user.UserBalanceService;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.common.PageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 用户-余额变更Controller
 *
 * @author SystemAuth
 * @date 2023-05-19
 */

@RestController(value = "H5UserBalanceController")
@RequestMapping("/api/userBalance")
@Api(tags = "用户-余额变更接口")
public class UserBalanceController extends BaseController {

    @Autowired
    private UserBalanceService userBalanceService;

    /**
     * 查询用户-余额变更列表
     */
    @ApiOperation(value = "列表", response = UserBalance.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.userBalanceService.selectUserbalanceList(pageParam,this.getLoginUser());
    }

    /**
     * 查询用户-余额变更列表
     */
    @ApiOperation(value = "提现记录", response = UserBalance.class)
    @PostMapping("/txList")
    public Object txList(@RequestBody PageParam pageParam) {
        return this.userBalanceService.txList(pageParam,this.getLoginUser());
    }

    /**
     * 提现记录统计
     */
    @ApiOperation(value = "提现记录统计", response = UserBalance.class)
    @GetMapping("/txListNum")
    public Object txListNum() {
        return this.userBalanceService.txListNum(this.getLoginUser());
    }
}
